<style>
.btn.btn-success-o.active{
    background: #00c568;
    color: #fff;
}
</style>
<div class='fui-page fui-page-current'>
	<div class='fui-content'>
			<div style="padding:0 0.5rem;">
			<div style="background:#fff;padding-bottom:1rem">
			<div class='fui-cell-group-o' style="margin:0.5rem 1rem;padding-top:0.5rem;">
				<div class='fui-cell-title c bold' style="padding-bottom:0.3rem">{{pagedata.cang.title}}</div>
				<div class='fui-cell-title c' style="color:#999;font-size:0.6rem;padding:0">(加倍包购买操作)</div>
				<div class='fui-cellone'>
					<div class='fui-cellone-label big bold' style='width:auto;'>选择加倍包</div>
				</div>
				<div class="fui-icon-group noborder col-2" style="margin-top:0;padding:0 0.5rem;max-height:5.5rem;overflow-y:scroll">
					<div ng-repeat="item in pagedata.pluginset.bao_set" ng-click="pagedata.post.baojifen=item.num;pagedata.post.baobei=item.bei;pagedata.upjifen2()" class="fui-icon-col-sm c" style="margin:0;margin-top:0.1rem;padding:0 0.2rem">
							<div ng-class="{'btn btn-success-o':1,'active':pagedata.post.baojifen==item.num}" style="line-height:1.4;margin:0;padding:0.3rem;width:100%">
							<div class="bold c">{{item.bei}}倍</div>
							<div class="gray c" style="font-size:12px;">消耗{{item.num}}个积分</div>
							</div>
					</div>
				</div>
				<div class='fui-cellone'>
					<div class='fui-cellone-label big bold' style='width:auto;'>选择种植记录</div>
				</div>
				<div style="padding:0 0.5rem;font-size:0.55rem;margin-top:-0.3rem">
						当前种植：<span class="red">{{pagedata.canlognum || 0}}</span>次，已购买加倍包：<span class="red">{{pagedata.isbaonum || 0}}</span>次，剩余可以参与加倍包：<span class="red">{{pagedata.lastbaonum || 0}}</span>次
				</div>
				<div class="radius" style="background:#f2f2f2;max-height:10rem;overflow-y:scroll">
				<div ng-repeat="item in pagedata.list" class='fui-cellone'>
					<div class='fui-cellone-info'>
						<div class="title" style="font-size:0.76rem;padding-bottom:0.2rem">
						<span>{{item.title}}</span>
						<span class="label label-info">{{item.statustitle}}</span>
						</div>
						<div class="subtitle" style="font-size:0.7rem">
							投入<span class="red">{{item.jifen ||0}}</span>个{{pagedata.pluginset.cd_title}}
							<span style="margin-left:0.3rem">收益<span class="red">{{item.jian_getrate}}%</span></span>
						</div>
						<div class="subtitle" style="font-size:0.7rem">
							{{item.createtime}}
						</div>
					</div>
					<div class="fui-cellone-remark noremark" style="width:auto;">
						<div ng-if="item.baobei<=1">
							<input type="checkbox" ng-checked="pagedata.post.canlogs[item.id]==1" ng-click="pagedata.toogle_mselect(item.id)" name="checkbox" class="fui-radio fui-radio-danger" style="margin-top:0.2rem"/>
						</div>
						<div ng-if="item.baobei>1">
							已购{{item.baobei}}倍
						</div>
					</div>
				</div>
				<div class="content-empty" ng-if="pagedata.list.length <1" style="margin-top:1rem">
				  <i class="icon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><div style="color: #999;font-size: .75rem">您暂时种植记录！</div>
				</div>
				</div>
			</div>
			<div class="weui_btn_area" style="margin:1rem 2rem;">
				<div class="c" style="font-size:0.6rem;margin-top:-0.3rem;color:red">
						购买加倍包，总共需积分{{pagedata.post.payjifen || 0}}个						
				</div>
				<a class='weui_btn weui_btn_primary' style="border-radius:1rem;background-color:#18bc9c;" ng-click="pagedata.topost();">确认购买加倍包？</a>
			</div>
			</div>
			</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.upjifen2=function(){
	var baojifen=scope.pagedata.post.baojifen;
	if(baojifen<=0){
		scope.pagedata.post.payjifen=0
		return false;
	}
	var total=0;
	var totalprice=0;
	var canlogs=scope.pagedata.post.canlogs
	canlogs.forEach(function(value,index){
	　	if(value==1){
			total++;
		}
	});
	scope.pagedata.post.payjifen=total*baojifen
	scope.$evalAsync();
}
//选择
scope.pagedata.toogle_mselect=function(id){
	var canlogs=scope.pagedata.post.canlogs
	canlogs[id]=canlogs[id]==1?0:1;
	scope.pagedata.post.canlogs=canlogs
	scope.pagedata.upjifen2();
	scope.$evalAsync();
}
scope.pagedata.topost=function(){
	scope.confirm({
		'message':'确认要支付吗？',
		'success':function(){
			scope.post(scope.pagedata.post,'/buybao/post/');
		},
		'fail':function(){}
	});
}
</script>